package jmectftest;

import com.jmectf.game.state.BattleState;
import com.jmectf.game.state.MenuState;
import com.jmex.editors.swing.settings.GameSettingsPanel;
import com.jmex.game.StandardGame;
import com.jmex.game.state.GameStateManager;

/**
 * <code>BattleTest</code> is used to test project <code>jmectf</code>.
 * It uses <code>BattleState</code>.
 * @author Nilay Kumar
 * @version Jul 13, 2009 : 12:13:47 PM
 * @see BattleState
 */
public class BattleTest {

	StandardGame game;
	BattleState gameState;
	
	/**
	 * <code>main</code> defines the entry point of the program.
	 * @param args command-line arguments.
	 */
	public static void main(String[] args) {
		BattleTest app = new BattleTest();
		try {
			app.start();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	private void start() throws InterruptedException {
		game = new StandardGame("jmectftest");
		if (GameSettingsPanel.prompt(game.getSettings())) {
			game.start();
			gameState = new BattleState(game);
			GameStateManager.getInstance().attachChild(gameState);
			gameState.setActive(true);
			MenuState menuState = new MenuState("MenuState", game);
			GameStateManager.getInstance().attachChild(menuState);
			menuState.setActive(false);
		}
	}

}
